﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace FxArchitect
{
    public static class RegexHelper
    {
        public const RegexOptions Options = RegexOptions.IgnoreCase | 
                                            RegexOptions.IgnorePatternWhitespace;

        static Regex rxVariable = new Regex(FxResources.Regex_Variables, Options);
        static Regex rxAnalyzeScope = new Regex(FxResources.Regex_Analyze_Scope, Options);



        public static void AnalyzeFile(string shaderCode)
        {
            MatchCollection mcScope = rxAnalyzeScope.Matches(shaderCode);
            MatchCollection mcVars = rxVariable.Matches(shaderCode);
            foreach (Match mScope in mcScope)
            {
                Group gGroups = mScope.Groups["Scope_Groups"];
                Group gBlocks = mScope.Groups["Scope_Blocks"];


            }
        }

        public static List<Match> FindVariables(string shaderCode)
        {
            List<Match> results = new List<Match>();

            

            return results;
        }
    }
}
